/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package entidad;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.Lob;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author Angela Maria
 */
@Entity
@Table(name = "log_line")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "LogLine.findAll", query = "SELECT l FROM LogLine l"),
    @NamedQuery(name = "LogLine.findByIdLogLine", query = "SELECT l FROM LogLine l WHERE l.idLogLine = :idLogLine"),
    @NamedQuery(name = "LogLine.findByEmergencia", query = "SELECT l FROM LogLine l WHERE l.logEmergencia = :logEmergencia"),
    @NamedQuery(name = "LogLine.findByVuelo", query = "SELECT l FROM LogLine l WHERE l.vueloIdVuelo = :vueloIdVuelo"),
    @NamedQuery(name = "LogLine.findByUsuarioCedula", query = "SELECT l FROM LogLine l WHERE l.usuarioCedula = :usuarioCedula"),
    @NamedQuery(name = "LogLine.findByFecha", query = "SELECT l FROM LogLine l WHERE l.fecha = :fecha")})
public class LogLine implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "id_log_line", nullable = false)
    private Integer idLogLine;
    @Basic(optional = false)
    @Column(name = "descripcion", nullable = false, length = 255)
    private String descripcion;
    @Lob
    @Column(name = "log_emergencia")
    private byte[] logEmergencia;
    @Basic(optional = false)
    @Column(name = "fecha", nullable = false)
    @Temporal(TemporalType.TIMESTAMP)
    private Date fecha;
    @JoinColumn(name = "vuelo_id_vuelo", referencedColumnName = "id_vuelo", nullable = false)
    @ManyToOne(optional = false)
    private Vuelo vueloIdVuelo;
    @JoinColumn(name = "usuario_cedula", referencedColumnName = "cedula", nullable = false)
    @ManyToOne(optional = false)
    private Usuario usuarioCedula;

    public LogLine() {
    }

    public LogLine(Integer idLogLine) {
        this.idLogLine = idLogLine;
    }

    public LogLine(Integer idLogLine, Date fecha) {
        this.idLogLine = idLogLine;
        this.fecha = fecha;
    }

    public Integer getIdLogLine() {
        return idLogLine;
    }

    public void setIdLogLine(Integer idLogLine) {
        this.idLogLine = idLogLine;
    }

    public String getDescripcion() {
        return descripcion;
    }

    public void setDescripcion(String descripcion) {
        this.descripcion = descripcion;
    }

    public byte[] getLogEmergencia() {
        return logEmergencia;
    }

    public void setLogEmergencia(byte[] logEmergencia) {
        this.logEmergencia = logEmergencia;
    }

    public Date getFecha() {
        return fecha;
    }

    public void setFecha(Date fecha) {
        this.fecha = fecha;
    }

    public Vuelo getVueloIdVuelo() {
        return vueloIdVuelo;
    }

    public void setVueloIdVuelo(Vuelo vueloIdVuelo) {
        this.vueloIdVuelo = vueloIdVuelo;
    }

    public Usuario getUsuarioCedula() {
        return usuarioCedula;
    }

    public void setUsuarioCedula(Usuario usuarioCedula) {
        this.usuarioCedula = usuarioCedula;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idLogLine != null ? idLogLine.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof LogLine)) {
            return false;
        }
        LogLine other = (LogLine) object;
        if ((this.idLogLine == null && other.idLogLine != null) || (this.idLogLine != null && !this.idLogLine.equals(other.idLogLine))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "entidad.LogLine[ idLogLine=" + idLogLine + " ]";
    }
    
}
